import React from 'react'
import { Input , Button } from 'antd';

const ButtonGroup = Button.Group;
export default React.createClass({
  getInitialState() {
    return {
    }
  },

  createSrvItem() {
    window.location.href = '#/service/serviceitems/create';
  },
  render() {
    return (
      <div className="serviceitem_top">
          <Input className="search" id="search" placeholder="请输入关键字"  onChange={ this.props.getSrvItemByKwd }/>
          <Button className="newitembtn" type="primary" icon="plus" onClick={ this.createSrvItem } >新增服务项</Button>

          <ButtonGroup className='tab-button'>
          <Button type="primary" icon="appstore" onClick={ this.props.switchToSquare } 
            className={ !this.props.visible ? "active" : null } />
          <Button type="primary" icon="bars" onClick={ this.props.switchToTable } 
            className={ this.props.visible ? "active" : null } />
          </ButtonGroup>

      </div>
    )
  }
});
